package demo3;

import java.io.*;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

public class Test  {
    public static void main22(String[] args) throws Exception{
        Stu s1 = new Stu(999,"a1");
        Stu s2 = new Stu(888,"a2");
        OutputStream os = new FileOutputStream("d:/1.txt");
        ObjectOutputStream oos = new ObjectOutputStream(os);
        oos.writeObject(s1);
        oos.writeObject(s2);
        oos.close();
    }

    public static void main(String[] args)throws Exception {
        InputStream is = new FileInputStream("d:/1.txt");
        ObjectInputStream ois = new ObjectInputStream(is);
        Object o1 = ois.readObject();
        Object o2 = ois.readObject();
        System.out.println(o1);
        System.out.println(o2);
        List c=null;
        c.stream();
    }


}
